package org.jason.interaction.mq.consumer;

import cn.dev33.satoken.stp.StpUtil;
import org.jason.interaction.service.ICommentService;
import org.jason.model.interaction.dtos.SendCommentDto;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class CommentConsumer {

    @Autowired
    private ICommentService commentService;

    //从队列接受评论并上传
    @RabbitListener(queues = "comment.queue")
    public void commentArticle(SendCommentDto dto) {
        commentService.sendComment(dto);
    }
}
